/****************************************************
          File Name:12-5.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Thu 01 Jan 2015 12:17:20 PM CST
*****************************************************/

#ifndef QUEUE_H_
#define QUEUE_H_

#include<iostream>

class Customer
{
    private:
        long arrive;
        int processtime;
    public:
        Customer() {arrive = processtime = 0;}

        void set(long when);
        long when() const { return arrive; }
        int ptime() const {return processtime;}
};

typedef Customer Item;

class Queue
{
    private:
        struct Node {Item item; struct Node *next;};
        enum {Q_SIZE = 10};
        Node *front;
        Node *rear;
        int items;
        const int qsize;

        Queue(const Queue & q) : qsize(0) {}  // const int qsize
        Queue & operator=(const Queue & q) { return *this; }
    public:
        Queue(int qs = Q_SIZE);
        ~Queue();
        bool isempty() const;
        bool isfull() const;
        int queuecount() const;
        bool enqueue(const Item &item);
        bool dequeue(Item &item);
};

#endif
